/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fh.view.player;

import fh.view.running.CurrentTourneyOverview;
import fh.model.Player;
import fh.view.*;

/**
 *
 * @author Bart
 */
public class DetailPlayer extends javax.swing.JFrame {

    Player aPlayer;

    /**
     * Creates new form DetailPlayer
     */
    public DetailPlayer() {
        initComponents();
    }

    public DetailPlayer(Player player) {
        initComponents();
        aPlayer = new Player();
        getPlayerData(player);
    }

    private void getPlayerData(Player player) {
        aPlayer = player;

        FirstNamePlayerField.setText(aPlayer.getFirstname());
        LastNamePlayerField.setText(aPlayer.getLastname());
        AddressPlayerField.setText(aPlayer.getAddress());
        EmailPlayerfield.setText(aPlayer.getEmail());
        ZipPlayerField.setText(aPlayer.getZipcode());
        CityPlayerField.setText(aPlayer.getCity());
        PhonePlayerField.setText(aPlayer.getPhonenumber());
        RatingPlayerField.setText("" + aPlayer.getRating());
        if (aPlayer.isVip() == true) {
            VipPlayerField.setText("Ja");
        } else {
            VipPlayerField.setText("Nee");
        }

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        CurrentTourneyButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        PlayerOverviewButton = new javax.swing.JButton();
        LocationEventMainButton = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        PhonePlayerField = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        CityPlayerField = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        EmailPlayerfield = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        ZipPlayerField = new javax.swing.JTextField();
        AddressPlayerField = new javax.swing.JTextField();
        LastNamePlayerField = new javax.swing.JTextField();
        FirstNamePlayerField = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        VipPlayerField = new javax.swing.JTextField();
        EditPlayerButton = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        RatingPlayerField = new javax.swing.JTextField();
        BacktoOverviewButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Detail speler");
        setMaximumSize(new java.awt.Dimension(800, 600));
        setMinimumSize(new java.awt.Dimension(800, 600));
        setResizable(false);

        CurrentTourneyButton.setText("Toernooi runnen");
        CurrentTourneyButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CurrentTourneyButtonActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 30)); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Full House");
        jLabel1.setToolTipText("");

        PlayerOverviewButton.setText("Speler beheer");
        PlayerOverviewButton.setMaximumSize(new java.awt.Dimension(111, 23));
        PlayerOverviewButton.setMinimumSize(new java.awt.Dimension(111, 23));
        PlayerOverviewButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                PlayerOverviewButtonActionPerformed(evt);
            }
        });

        LocationEventMainButton.setText("Locatie & Event");
        LocationEventMainButton.setMaximumSize(new java.awt.Dimension(111, 23));
        LocationEventMainButton.setMinimumSize(new java.awt.Dimension(111, 23));
        LocationEventMainButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LocationEventMainButtonActionPerformed(evt);
            }
        });

        jLabel2.setText("Voornaam:");

        PhonePlayerField.setEditable(false);
        PhonePlayerField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                PhonePlayerFieldActionPerformed(evt);
            }
        });

        jLabel6.setText("Stad:");

        CityPlayerField.setEditable(false);
        CityPlayerField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CityPlayerFieldActionPerformed(evt);
            }
        });

        jLabel5.setText("Postcode:");

        jLabel4.setText("Adres:");

        EmailPlayerfield.setEditable(false);
        EmailPlayerfield.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EmailPlayerfieldActionPerformed(evt);
            }
        });

        jLabel3.setText("Achternaam:");

        ZipPlayerField.setEditable(false);
        ZipPlayerField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ZipPlayerFieldActionPerformed(evt);
            }
        });

        AddressPlayerField.setEditable(false);
        AddressPlayerField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddressPlayerFieldActionPerformed(evt);
            }
        });

        LastNamePlayerField.setEditable(false);
        LastNamePlayerField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LastNamePlayerFieldActionPerformed(evt);
            }
        });

        FirstNamePlayerField.setEditable(false);
        FirstNamePlayerField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                FirstNamePlayerFieldActionPerformed(evt);
            }
        });

        jLabel9.setText("Bekende speler:");

        jLabel8.setText("E-mail:");

        jLabel7.setText("Telefoonnummer:");

        VipPlayerField.setEditable(false);
        VipPlayerField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                VipPlayerFieldActionPerformed(evt);
            }
        });

        EditPlayerButton.setText("Wijzigen");
        EditPlayerButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditPlayerButtonActionPerformed(evt);
            }
        });

        jLabel10.setText("Rating:");

        RatingPlayerField.setEditable(false);
        RatingPlayerField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RatingPlayerFieldActionPerformed(evt);
            }
        });

        BacktoOverviewButton.setText("Terug naar overzicht");
        BacktoOverviewButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BacktoOverviewButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(29, 29, 29)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel3)
                                            .addComponent(jLabel2)
                                            .addComponent(jLabel4)
                                            .addComponent(jLabel5)
                                            .addComponent(jLabel6)
                                            .addComponent(jLabel7)
                                            .addComponent(jLabel8)
                                            .addComponent(jLabel9)
                                            .addComponent(jLabel10))
                                        .addGap(39, 39, 39)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(PhonePlayerField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
                                            .addComponent(LastNamePlayerField)
                                            .addComponent(AddressPlayerField)
                                            .addComponent(ZipPlayerField)
                                            .addComponent(FirstNamePlayerField)
                                            .addComponent(CityPlayerField)
                                            .addComponent(RatingPlayerField)
                                            .addComponent(EmailPlayerfield)
                                            .addComponent(VipPlayerField)))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(LocationEventMainButton, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(PlayerOverviewButton, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(CurrentTourneyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 67, Short.MAX_VALUE)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(EditPlayerButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(BacktoOverviewButton)
                        .addGap(66, 66, 66))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(CurrentTourneyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(PlayerOverviewButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(LocationEventMainButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(37, 37, 37)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(LastNamePlayerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(AddressPlayerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(ZipPlayerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(CityPlayerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(PhonePlayerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(FirstNamePlayerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(EmailPlayerfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(VipPlayerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(RatingPlayerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10))
                        .addContainerGap(140, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(EditPlayerButton)
                            .addComponent(BacktoOverviewButton))
                        .addGap(74, 74, 74))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void CurrentTourneyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CurrentTourneyButtonActionPerformed
        new CurrentTourneyOverview().setVisible(true);
        this.dispose();
    }//GEN-LAST:event_CurrentTourneyButtonActionPerformed

    private void PlayerOverviewButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PlayerOverviewButtonActionPerformed
        new PlayerOverview().setVisible(true);
        this.dispose();
    }//GEN-LAST:event_PlayerOverviewButtonActionPerformed

    private void LocationEventMainButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LocationEventMainButtonActionPerformed
        new LocationEventOverview().setVisible(true);
        this.dispose();
    }//GEN-LAST:event_LocationEventMainButtonActionPerformed

    private void EmailPlayerfieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EmailPlayerfieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_EmailPlayerfieldActionPerformed

    private void ZipPlayerFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ZipPlayerFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ZipPlayerFieldActionPerformed

    private void LastNamePlayerFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LastNamePlayerFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_LastNamePlayerFieldActionPerformed

    private void AddressPlayerFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddressPlayerFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_AddressPlayerFieldActionPerformed

    private void FirstNamePlayerFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FirstNamePlayerFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_FirstNamePlayerFieldActionPerformed

    private void EditPlayerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditPlayerButtonActionPerformed
        new EditPlayer(aPlayer).setVisible(true);
        this.dispose();
    }//GEN-LAST:event_EditPlayerButtonActionPerformed

    private void BacktoOverviewButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BacktoOverviewButtonActionPerformed
        new PlayerOverview().setVisible(true);
        this.dispose();
    }//GEN-LAST:event_BacktoOverviewButtonActionPerformed

    private void CityPlayerFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CityPlayerFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_CityPlayerFieldActionPerformed

    private void PhonePlayerFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PhonePlayerFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_PhonePlayerFieldActionPerformed

    private void VipPlayerFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_VipPlayerFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_VipPlayerFieldActionPerformed

    private void RatingPlayerFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RatingPlayerFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_RatingPlayerFieldActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(DetailPlayer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(DetailPlayer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(DetailPlayer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(DetailPlayer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new DetailPlayer().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField AddressPlayerField;
    private javax.swing.JButton BacktoOverviewButton;
    private javax.swing.JTextField CityPlayerField;
    private javax.swing.JButton CurrentTourneyButton;
    private javax.swing.JButton EditPlayerButton;
    private javax.swing.JTextField EmailPlayerfield;
    private javax.swing.JTextField FirstNamePlayerField;
    private javax.swing.JTextField LastNamePlayerField;
    private javax.swing.JButton LocationEventMainButton;
    private javax.swing.JTextField PhonePlayerField;
    private javax.swing.JButton PlayerOverviewButton;
    private javax.swing.JTextField RatingPlayerField;
    private javax.swing.JTextField VipPlayerField;
    private javax.swing.JTextField ZipPlayerField;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    // End of variables declaration//GEN-END:variables
}
